package com.atguigu.test;

import com.atguigu.dwm.model.bean.DmTable;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;

public class Demo {


    public static void main(String[] args) {
        DmTable dmTable = new DmTable();
        dmTable.setTableName("testA");
        setName(dmTable);
        System.out.println(dmTable.getTableName());/////   BB

        String tableName = "testA";
        setName(tableName);
        System.out.println(tableName);///// A

        StringBuffer tableNamebf = new StringBuffer("testA");
        setName(tableNamebf);
        System.out.println(tableNamebf);//// BB

         List<String> tableNameList = new ArrayList<>();
        tableNameList.add("testA");
        setName(tableNameList);
        System.out.println(tableNameList.get(0));///BB

    }

    public static void setName(List<String> tableNameList) {
        tableNameList.set(0,"testB");
    }

    public static void setName(String tableName) {
        tableName="testB";
    }

    public static void setName(StringBuffer tableName) {
        tableName.append("BBB");
    }

    public static void setName(DmTable dmTable) {
        dmTable.setTableName("testB");
    }

}
